package cn.iocoder.yudao.module.wine.api;

import cn.iocoder.yudao.module.wine.api.dto.BusinessUserDTO;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;

/**
 * @author zyc
 * @createDate 2024/4/22 20:12
 */
public interface BusinessUserApi {
    /**
     * 添加商家信息
     * @param dto
     * @return
     */
    BusinessUserDTO registerBusinessUser(BusinessUserDTO dto);

    void updateBusinessUserInfo(BusinessUserDTO dto);

    BusinessUserDTO getBusinessUserByUserId(Long userId);

    /**
     * 获得会员用户信息们
     *
     * @param ids 用户编号的数组
     * @return 用户信息们
     */
    List<BusinessUserDTO> getBusinessUserList(Collection<Long> ids);

    /**
     * 获得会员用户 Map
     *
     * @param ids 用户编号的数组
     * @return 会员用户 Map
     */
    default Map<Long, BusinessUserDTO> getBusinessUserMap(Collection<Long> ids) {
        List<BusinessUserDTO> list = getBusinessUserList(ids);
        return convertMap(list, BusinessUserDTO::getUserId);
    }

}
